home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / spoc88 / cflt20 / sigtest.c < prev    next >
Text File  |  1988-04-15  |  432b  |  18 lines

  1. #include <signal.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <setjmp.h>
  5.  
  6.      extern jmp_buf jump1;
  7.  
  8.      void cdecl fphandler(int sig)
  9.      {
  10.           fprintf(stderr,"Floating point error.\n");
  11.           /* clean off the chip */
  12.           _fpreset();
  13.           /* reinstall the exception handler */
  14.           signal(SIGFPE,fphandler);
  15.           /* jump to a safe place */
  16.           longjmp(jump1);
  17.      }
  18.